//
//  MySettingPrivacyViewController.m
//  DreamSoftReimburse
//
//  Created by 刘应平 on 17/4/26.
//  Copyright © 2017年 ZJ. All rights reserved.
//

#import "MySettingPrivacyViewController.h"
#import "MySettingPritaveTableViewCell.h"
#import "MysettingModel.h"
#import "GesturePasswordViewController.h"
#import "LPFingerPrintViewController.h"
@interface MySettingPrivacyViewController ()<UITableViewDelegate,UITableViewDataSource,MySettingPritaveTableViewCellDelegate>
/**  table  */
@property (strong, nonatomic) UITableView  *tableView;
/**  数据  */
@property (strong, nonatomic) NSMutableArray  *data;

@end

@implementation MySettingPrivacyViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.titlelabel.text = @"隐私设置";
    [self getDataSource];
    [self layoutUI];
}

#pragma mark - 数据
- (void)getDataSource{
    self.data = [NSMutableArray array];
    NSArray *array = @[
//                       @{@"image": @"mine_set_yinsi_ssmm", @"title": @"手势密码"},
                       @{@"image": @"mine_set_yinsi_zwdl", @"title": @"指纹解锁"},
//                       @{@"image": @"mine_set_yinsi_srzf", @"title": @"生日祝福"}
                       ];
    for (NSDictionary *dic in array) {
        [self.data addObject:[MysettingModel yy_modelWithDictionary:dic]];
    }
    
}


#pragma mark - 界面
- (void)layoutUI{
    [self.view addSubview:self.tableView];
    UIView *head = [[UIView alloc] initWithFrame:CGRectMake(0, 0, [UIScreen zj_screenWith], 12 * [UIScreen zj_screenHScale])];
    head.backgroundColor = [UIColor themeGrayColor];
    self.tableView.tableHeaderView = head;
    UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, [UIScreen zj_screenWith], 30 * [UIScreen zj_screenHScale])];
    label.text = @"开启后，生日当天获得专属皇冠，生日信息将提醒好友及同事.";
    label.textColor = [UIColor lightGrayColor];
    label.textAlignment = NSTextAlignmentCenter;
    label.font = [UIFont systemFontOfSize:12 * [UIScreen zj_textFontScale]];
//    self.tableView.tableFooterView = label;
}


#pragma mark - 私有方法


#pragma mark - 监听事件


#pragma mark - 协议代理
- (void)MySettingPritaveTableViewCellDelegate_showString{
    [YJProgressHUD showMessage:@"请在手机设置通用中设置Touch ID与密码" inView:self.view];
}


/**  UITableViewDataSource,UITableViewDelegate  */
/**  返回组个数  */
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
    return 1;
}
/**  返回cell个数  */
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    return self.data.count;
}
/**  返回cell高度  */
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
    return 50 * [UIScreen zj_screenHScale];
}
/**  cell初始化  */
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    static NSString *cellid = @"cellId";
    MySettingPritaveTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:cellid];
    if (!cell) {
        cell = [[MySettingPritaveTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellid];
    }
    cell.delegate = self;
    cell.model = self.data[indexPath.row];
    return cell;
}
/**  cell的点击事件  */
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
//    switch (indexPath.row ) {
//        case 0:
//        {
//            GesturePasswordViewController *vc = [[GesturePasswordViewController alloc] init];
//            [self.navigationController pushViewController:vc animated:YES];
//        }
//            break;
//        case 1:
//        {
//            LPFingerPrintViewController *vc = [[LPFingerPrintViewController alloc] init];
//            [self.navigationController pushViewController:vc animated:YES];
//        }
//            break;
//            
//        default:
//            break;
//    }
}

#pragma mark - 懒加载
/**  初始化tableView  */
- (UITableView *)tableView{
    if (!_tableView) {
        _tableView = [[UITableView alloc] initWithFrame:CGRectMake(0, LP_TopHeight, self.view.bounds.size.width, self.view.bounds.size.height - LP_TopHeight) style:UITableViewStylePlain];
        _tableView.dataSource = self;
        _tableView.delegate = self;
        _tableView.backgroundColor = [UIColor themeGrayColor];
        _tableView.separatorColor = [UIColor clearColor];
    }
    return _tableView;
}
@end
